<!DOCTYPE HTML>
<html>
<head>
<title>Baliwag Online POS - Admin</title>
<script src="resources/js/plugins/jquery-1.9.0.min.js"></script>
<script src="resources/js/jquery-ui/jquery-ui-1.10.0.custom.min.js"></script><!-- JQuery UI -->
<script src="resources/js/main.js"></script>
<script src="resources/js/admin.js"></script>

<link rel="stylesheet" type="text/css" href="resources/css/main.css" />
<link rel="stylesheet" type="text/css" href="resources/css/admin.css" />
<link rel="stylesheet" type="text/css" href="resources/css/employee.css" />
<link rel="stylesheet" type="text/css" href="resources/css/products.css" />
<link rel="stylesheet" type="text/css" href="resources/css/ribbon.css" />
<link rel="stylesheet" type="text/css" href="resources/css/jquery-ui/south-street/jquery-ui-1.10.0.custom.min.css" /><!-- JQuery UI -->
</head>
<body>
<div id="wrapper">

	<?php include VIEW . '/templates/header' . EXT ;?>
	<?php include VIEW . '/templates/loading' . EXT ;?>
	<?php include VIEW . '/templates/error' . EXT ;?>
	<?php include VIEW . '/templates/alert' . EXT ;?>
	
	<div>
		<a class="page-name-link" href="index.php?c=employee&m=home">HOME</a>  <span class="page-name-active">> ADMIN-EMPLOYEE</span>
	</div>

	<div>
				  		<script language="javascript">

	  function alphaOnly(e) {
	  var code;
	  if (!e) var e = window.event;
	  if (e.keyCode) code = e.keyCode;
	  else if (e.which) code = e.which;
	  if ((code >= 48) && (code <= 57)) { return false; }
      return true;
    }
	</script>
		 <SCRIPT language=Javascript>
       <!--
       function isNumberKey(evt)
       {
          var charCode = (evt.which) ? evt.which : event.keyCode;
          if (charCode != 46 && charCode > 31 
            && (charCode < 48 || charCode > 57))
             return false;

          return true;
       }
       //-->
    </SCRIPT>
		<!-- LEFT -->
		<div class="employee-left-col">
			<fieldset id="fieldset-alert">
				  <legend>UPDATE EMPLOYEE INFORMATION</legend>
				  	<form action="">
				  	<input type="hidden" id="employeeId" name="emloyeeId" />
				  	<div class="admin-employee-update">
				  		<div class="admin-employee-row">
				  			<span>Firstname:</span> <input type="text" id="firstname" name="firstname" onkeypress="return alphaOnly(event);" />
				  			<span>Contact #:</span> <input type="text" id="contact" name="contact" onkeypress="return isNumberKey(event)" />
				  		</div>
				  		<div class="admin-employee-row">
				  			<span>Lastname:</span> <input type="text" id="lastname" name="lastname" onkeypress="return alphaOnly(event);" />
				  			<span>Hiredate:</span> <input type="text" id="hiredate" name="hiredate" readonly="readonly"/>
				  		</div>
				  		<div class="admin-employee-row">
				  			<span>Address:</span> <textarea id="address" name="address" rows="4" cols="65"></textarea>
				  		</div>
	
				  		<div class="admin-employee-row">
				  			<span>Branch:</span>
				  			<select id="branch" name="branch">
				  				<?php foreach ($this->display['branch'] as $branch): ?>
				  					<option value="<?php echo $branch->getBranchId(); ?>"><?php echo $branch->getBranch(); ?>-<?php echo (strlen($branch->getLocation()) > 40) ? substr($branch->getLocation(),0,37).'...' : $branch->getLocation(); ?></option>
				  				<?php endforeach; ?>
				  			</select>
				  		</div>
				  		
				  		<div class="admin-employee-row">
				  			<span>Position:</span>
				  			<select id="position" name="position">
				  				<?php foreach ($this->display['position'] as $position): ?>
				  					<option value="<?php echo $position->getPositionId(); ?>"><?php echo $position->getPositionName(); ?></option>
				  				<?php endforeach; ?>
				  			</select>
				  		</div>
				  		
				  		<div class="admin-employee-row">
				  			<span>Employee Status:</span>
				  			<select id="empStatus" name="empStatus">
				  				<?php foreach ($this->display['status'] as $status): ?>
				  					<option value="<?php echo $status->getEmployeeStatusId(); ?>"><?php echo $status->getStatus(); ?></option>
				  				<?php endforeach; ?>
				  			</select>
				  		</div>
				  	</div>
				  		<div class="admin-employee-row admin-employee-btn-row">
				  			<input type="button" id="updateEmployee" value="Update" class="button-jquery-ui" />
				  		</div>
				  	
				  	</form>
			</fieldset>
		</div>
	
		<!-- RIGHT -->
		<div class="employee-right-col">
			<!-- <img width=305 alt="bPos" src="resources/images/bPos.png"> -->
				<fieldset id="fieldset-alert">
				  	<legend>EMPLOYEES</legend>
				  	
				  	<div class="div-employees">
						<div class="employees-header">
							<div class="employees-col1">Employee List</div>
						</div>
						
						<!-- LIST OF EMPLOYEES -->
						<?php $i=-1; ?>
						<?php foreach ($this->display['employees'] as $employee): 
							$i++;
						?>	
							<div id="<?php echo $employee->getEmployeeId();?>" onclick="getEmpDetails('<?php echo $employee->getEmployeeId();?>')" class="employee-row <?php if($i%2 == 0){ ?>even<?php }else{ ?>odd<?php } ?>"><span class="bold">[<?php echo $employee->getEmployeeId();?>] </span><?php echo $employee->getFirstName();?> <?php echo $employee->getLastName();?></div>
						<?php endforeach; ?>
						
						
					</div>
					
					<div class="admin-employee-row admin-employee-btn-row">
				  			<input type="button" id="addEmployee-btn" value="Add Employee" class="button-jquery-ui" />
				  	</div>
				  	
			  	</fieldset>
			
			</div>
		<div class="clear-both"></div>

	</div>
</div>

<!-- ADD -->
<?php include VIEW . '/components/addEmployee' . EXT ;?>

<div id="footer">&copy; 2013 Baliwag Lechon Manok.</div>
</body>
</html>
